home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / cstrings.arc / STRBLANK.C < prev    next >
Encoding:
Text File  |  1985-08-06  |  1.6 KB  |  81 lines

  1. /*
  2.     CSTRINGS.LBR VERSION 1.0
  3.     Spark Software, Inc.
  4.  
  5.         If you find this software of use, it is requested that you send
  6.         a donation ($10.00 suggested) to:
  7.  
  8.             Spark Software, Inc.
  9.             24 Royal Crest Dr., #5
  10.             Nashua, NH  03060
  11.  
  12.         Upon receiving your donation, your name will be added to the 
  13.         List of Registered Users, and future updates can be obtained
  14.         from the SPARKIE RBBS at (603) 888-8179.
  15.  
  16.         If you include an extra $10.00 with your donation, the newest
  17.         version of CSTRINGS.LBR will be mailed to you.
  18.  
  19.         Call SPARKIE RBBS at the number above for other Spark Software
  20.         products!!!
  21. */
  22.  
  23. /*
  24.  * strb (s, n1, n)
  25.  * char *s;
  26.  * int n1, n;
  27.  *
  28.  * This function places a blank at all of the character positions from
  29.  * n1 to n in string s.  Note that string s starts at character position
  30.  * 0 and not character position 1.
  31.  */
  32.  
  33. strb (s, n1, n) 
  34. char *s;
  35. int n1, n;
  36. {
  37.     int i;
  38.       
  39.     for (i = n1; i <= n; i++)
  40.          s[i] = ' ';
  41. }    /* strb */
  42.  
  43. /*
  44.  * strblf (s, n)
  45.  * char *s;
  46.  * int n;
  47.  *
  48.  * This function places blanks in all character positions in s, from position
  49.  * 0 thru position n.
  50.  */
  51.  
  52. strblf (s, n)
  53. char *s;
  54. int n;
  55. {
  56.     int i;
  57.      
  58.     for (i = 0; i <= n; i++)
  59.          s[i] = ' ';
  60. } /* strblf */
  61.  
  62. /*
  63.  *    strbrt (s, n)
  64.  * char *s;
  65.  * int n;
  66.  *
  67.  * This function places blanks in s starting at position n, and ending
  68.  * at the last non-null character in the string.
  69.  */
  70.  
  71. strbrt (s, n)
  72. char *s;
  73. int n;
  74. {
  75.     char *c;
  76.  
  77.     c = &s[n];
  78.     while (*c != '\0')
  79.          *c++ = ' ';
  80. } /* strbrt */
  81.